import ReportList from '../../Component/ReportList/index';
import * as ReportApi from '../../../apis/report';
import {REPORT_TYPE} from '../../Component/ReportList/Const';
import {inject, observer} from 'mobx-react';
import {observable,action,toJS} from 'mobx';
let _this = null
@inject('blogMyAttention')
@inject('blogReport')

@observer
class HisReport extends React.Component {
	constructor(props) {
		super(props);
        this.state = {
            loading: true,
            data: {}
        };
        _this = this
	}
    
    getReportTable(params = {}) {
        // this.setState({
        //     loading: true
        // });
        params.blogId = _this.props.userId;
        // let {getReportTable} = _this.props.blogMyAttention;
        let {getReportTable} = _this.props.blogReport;
        getReportTable(params)
        // ReportApi.getReportTable(params).then(result => {
        //     this.setState({
        //         loading: false,
        //         data: result.tableInfo
        //     });
        // });
    }
	
	render() {
        let {loading, data} = this.state;
        let {title} = this.props;
		return (
		    <div className="hisReport">
                <ReportList ecId={`${this && this.props && this.props.ecId || ''}_ReportList@394e41`}
                    owner={{key:REPORT_TYPE.my, title: title}}
                    loading={loading}
                    data={data}
                    blogReport = {this}
                />
            </div>
		);
	}
}

export default HisReport;